<%--
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style type="text/css">
    .pageFormContent .textInput { width: 280px; }
    .pageFormContent label { width: 100px; }
    .gray { color: gray; }
</style>
<div class="pageContent" style="padding-top: 1px;width:580px;height:290px;">
    <form id="pagerForm" method="post" action="<c:url value='/sys/resource/add'/>" class="pageForm required-validate"
          onsubmit="return validateCallback(this,callbackForSubmit);">
        <div class="pageFormContent">
            <p>
                <label for="txt_resource_name" class="required">资源名称</label>
                <input id="txt_resource_name" type="text" name="name" class="required" maxlength="50" />
            </p>
            <p>
                <label for="txt_resource_pkg" class="required">资源类名路径</label>
                <input id="txt_resource_pkg" type="text" name="pkg" class="required" maxlength="251" />
            </p>
            <p>
                <label for="txt_resource_method" class="required">资源方法</label>
                <input id="txt_resource_method" type="text" name="sysResource.method" class="required" maxlength="50" />
            </p>
            <p>
                <label for="txt_resource_remark">备注信息</label>
                <input id="txt_resource_remark" type="text" name="remark" maxlength="300" />
            </p>
            <p>
                <label for="txt_resource_sort">排序</label>
                <input id="txt_resource_sort" type="text" name="sort" class="required number" maxlength="4" />
            </p>
            <p>
                <label for="txt_resource_pid" class="required">上一级资源</label>
                <select id="txt_resource_pid" name="parentId" class="combox">
                    <option value="0">请选择</option>
                    <c:forEach var="record" items="${list}" varStatus="vs">
                        <option value="${record.id}">${record.name}</option>
                    </c:forEach>
                </select>
            </p>
            <!-- -->
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">保存</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>


<script type="text/javascript">
    function callbackForSubmit(resp, st, xhr) {
        if (resp && resp.succ) {
            alertMsg.info("添加成功！");
            $.pdialog.closeCurrent();
            navTab.reloadFlag('page_sys_resource_list')
        } else {
            alertMsg.info(resp.msg + "!");
        }
    }
</script>